home *** CD-ROM | disk | FTP | other *** search
/ Interactive Web Graphics with Shout 3D / Interactive Web Graphics With Shout 3D.iso / mac / Code / Chapter03 / twoboxes.wrl < prev   
Text File  |  2000-06-23  |  1KB  |  69 lines

  1. #VRML V2.0 utf8
  2.  
  3. DEF PARENT Transform {
  4.  
  5.   translation    0 0 0
  6.  
  7.  
  8.   children [
  9.  
  10.     Shape {
  11.            appearance    Appearance {
  12.               material    Material {
  13.                 diffuseColor 1 0 0
  14.               }
  15.             }
  16.  
  17.             geometry    IndexedFaceSet {
  18.           coord    Coordinate {
  19.             point    [ -1 1 1,
  20.                   -1 -1 1,
  21.                   1 1 1,
  22.                   1 -1 1,
  23.                   1 1 -1,
  24.                   1 -1 -1,
  25.                   -1 1 -1,
  26.                   -1 -1 -1 ]
  27.           }
  28.                  coordIndex    [ 0, 1, 3, 2, -1, 4, 5, 7,
  29.                     6, -1, 6, 7, 1, 0, -1, 2,
  30.                     3, 5, 4, -1, 6, 0, 2, 4,
  31.                     -1, 1, 7, 5, 3, -1 ]
  32.  
  33.             } #end Parent IndexedFaceSet
  34.       } #end of Parent Shape
  35.  
  36.     DEF CHILD Transform {
  37.  
  38.           translation    2.5 0 0
  39.  
  40.           children    Shape {
  41.                 appearance    Appearance {
  42.                   material    Material {
  43.                     diffuseColor 0 0 1
  44.                       }
  45.                 }
  46.             geometry    IndexedFaceSet {
  47.                   coord    Coordinate {
  48.                 point    [ -1 1 1,
  49.                       -1 -1 1,
  50.                       1 1 1,
  51.                       1 -1 1,
  52.                       1 1 -1,
  53.                       1 -1 -1,
  54.                       -1 1 -1,
  55.                       -1 -1 -1 ]
  56.               }
  57.                   coordIndex    [ 0, 1, 3, 2, -1, 4, 5, 7,
  58.                         6, -1, 6, 7, 1, 0, -1, 2,
  59.                         3, 5, 4, -1, 6, 0, 2, 4,
  60.                         -1, 1, 7, 5, 3, -1 ]
  61.  
  62.                 } #end Child IndexedFaceSet
  63.           } #end of Child Shape
  64.     } #end of Child Transform
  65.  
  66.  
  67.   ]#end of Children of Parent Transform
  68.  
  69. } #end of Parent Transform